<?php

namespace app\single\model;

use think\Model;

class LogassetsModel extends Model
{

    protected $append = ['update_value'];

    public function initialize()
    {
        $this->table = config("database.game") . ".log_assets";
    }

    // 获取器：自动计算 a - b
    public function getUpdateValueAttr($value, $data)
    {
        return $data['new_value'] - $data['old_value'];
    }
}